﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DreamBox.Admin.File
{
    public partial class FileList : BLL.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindList("");
        }
        void BindList(string where)
        {
            PagerList.TableName = "dbox_FileContents";
            PagerList.FldName = "FileID";
            PagerList.PagerControls = RepeaterList;
            PagerList.PageSize = 10;
            PagerList.Where = where;
            PagerList.Order = 1;
        }
        protected void LinkBtnDelete_Click(object sender, EventArgs e)
        {
            LinkButton linkBtn = sender as LinkButton;
            int FileID = int.Parse(linkBtn.ToolTip);
            if (FileID > 0)
            {
                Model.FileContents m = new Model.FileContents();
                m.FileID = FileID;

                DAL.MAction action = new DAL.MAction();
                if (action.Delete(m))
                {
                    BLL.Admin.Tips.DetailedTips(this, "操作成功", "/File/FileList.aspx", "1");
                }
            }
        }
    }
}